{extend name="public:base" /}

{block name="css"}
<style>
  .census span {
    display: block;
    font-size: 16px;
    font-weight: bold;
    float: left;
    margin-left: 60px;
  }
</style>
{/block}

{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">

                    <div class="row">
                        <div class="col-sm-6 m-b-sm census">
                            <span class="all_video_count" style="margin-left: 0">当前监测：{$all_count}</span>
                            <span class="error_music">当前异常次数：{$error_count}</span>
                        </div>
                    </div>

                    <div class="row search-form">
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <input placeholder="请选择开始时间" value="{:input('start_time')}" type="text" name="start_time" class="form-control form-control-lg screen-date" readonly="" lay-key="1">
                            </div>
                        </div>

                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <input placeholder="请选择结束时间" value="{:input('end_time')}" type="text" name="end_time" class="form-control form-control-lg screen-date" readonly="" lay-key="1">
                            </div>
                        </div>

                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <select class="form-control form-control-lg" name="style">
                                    <option value="0">请选择处理状态</option>
                                    <option value="1" {:input('style') == 1 ? 'selected' : ''}>已查看</option>
                                    <option value="2" {:input('style') == 2 ? 'selected' : ''}>已处理</option>
                                    <option value="3" {:input('style') == 3 ? 'selected' : ''}>暂不处理</option>
                                </select>
                            </div>
                        </div>

                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <button type="button" class="btn btn-primary btn-lg screen-btn">搜索</button>
                            </div>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>

                    <div class="row">
                        <div class="col-sm-6 m-b-sm census">
                            <span style="margin-left: 0">监测网址：<a href="https://www.xntv.tv" target="_blank">https://www.xntv.tv</a></span>
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th>监测时间</th>
                                <th>访问状态</th>
                                <th>持续时间</th>
                                <th>处理状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.check_time|timeFormat}</td>
                                {if $vo.status == 0}
                                <td style="color: red">异常</td>
                                {else /}
                                <td style="color: green">正常</td>
                                {/if}
                                <td>{$vo.status == 0 ? errorKeepTime(1, 0, $vo.id, $vo.check_time) : ''}</td>
                                <td>{$vo.style_desc}</td>
                                <td>
                                    {if $vo.status == 0}
                                    <a href="{:url('indexDetail', ['id' => $vo.id])}" class="btn btn-white btn-sm" style="color: red"><i class="iconfont icon-edit"></i> 处理 </a>
                                    {/if}
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                        {if !empty($list)}{$list->render()}{/if}
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>

{/block}

{block name="js"}
<script src="/static/laydate/laydate.js"></script>
<script>
    laydate.render({
        elem: '.screen-date' //指定元素
    });
</script>

{/block}

